<template>
  <transition name="fade-">
    <div class="popup" v-on:touchstart="onTouchStart">
      <div class="content">
        <slot></slot>
      </div>
      <a class="btn-close" href="javascript:;"
        v-on:click="$emit('close')">&times;</a>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'popup',

  methods: {
    onTouchStart(evt) {
      // evt.preventDefault()
    }
  }
}
</script>

<style lang="less" scoped>
.popup {
  z-index: 1000;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 0 0 80px 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;

  backdrop-filter: blur(10px);

  .content {
    overflow: auto;
    height: 100%;
    padding: 30px;
    margin-bottom: 15px;

    -moz-overflow-scrolling: touch;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
  }

  .btn-close {
    display: block;
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 50%;

    text-align: center;
    line-height: 40px;
    font-size: 20px;
    color: #ddd;
  }
}
</style>
